export const resolverList: ((result: boolean) => void)[] = [];

export const login = async () => {
  const userStore = $store.user();
  userStore.clearUserInfo();
  userStore.userInfo = undefined;
  if (!userStore.logining) {
    userStore.logining = true;
  }
  const pages = getCurrentPages();
  const currentPage = pages[pages.length - 1];
  switch (currentPage.route) {
    case 'pages/index/index':
    case 'pages/marketing/marketing-page':
    case 'pages/ecommerce/ecommerce-page':
      break;
    default:
      uni.reLaunch({ url: '/pages/index/index' });
  }
  return false;
};
